/**
 * 
 */
package xj.toolkit.fsm.core;

import java.util.Map;

import org.apache.commons.collections4.Closure;

import xj.toolkit.fsm.MutableFSMContext;


/**
 * @author isdom
 *
 */
public interface SmartContext extends MutableFSMContext {

	public interface StatusListener {
		public void onActive(final SmartContext ctx);
		public void onUnactive(final SmartContext ctx);
	}
	
	public void	setStatusListener(final StatusListener listener);
	
	public boolean setActived();

	public void endOfDispatchEvent(final Closure dispatchEvent);
	
	public void processEvent(final Object event, final Closure dispatchEvent);
	
	public long	getTimeToActive();

    public Map<String, Long> getStateLiveTime();

    public void setStateLiveTime(String stateName, long ttl);
}
